package com.eonmind.ai.converts;

import com.eonmind.ai.dto.AiBiDto;
import com.eonmind.common.provider.entity.ai.AiUserModelConsumeHistory;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * @author Xujie
 * @since 2025/5/29 21:45
 **/


public class AiBiConvert {
    public static List<AiBiDto.UserConsumeData> toUserConsumeDataList(List<AiUserModelConsumeHistory> aiUserModelConsumeHistoryList) {
        return aiUserModelConsumeHistoryList.stream()
                .map(AiBiConvert::toUserConsumeData)
                .toList();
    }

    private static AiBiDto.UserConsumeData toUserConsumeData(AiUserModelConsumeHistory aiUserModelConsumeHistory) {
        AiBiDto.UserConsumeData userConsumeData = new AiBiDto.UserConsumeData();
        BeanUtils.copyProperties(aiUserModelConsumeHistory, userConsumeData);
        return userConsumeData;

    }
}
